package com.example.binpacking.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.binpacking.model.Result;
import com.example.binpacking.model.SubjectView;
import com.example.binpacking.model.dto.SubjectViewDto;
import com.example.binpacking.service.SubjectViewService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;
import java.util.List;

@RestController
@RequestMapping("/pelicanpsyc/api")
public class SubjectViewController {
    @Autowired
    private SubjectViewService subjectViewService;

//    @GetMapping("/subjectview")
//    public Result getAllUserViews() {
//        List<SubjectView> list = subjectViewService.list();
//        return Result.success(list);
//    }
    @ApiOperation("获取视图信息")
    @PostMapping("/getMappedSubject")
    public Result getMappedSubject(@RequestBody SubjectViewDto subjectViewDto) {
        Page<SubjectView> subject = subjectViewService.getBySubjectPage(subjectViewDto.getLoginid(),subjectViewDto.getFinishflag(),subjectViewDto.getCurrentpage(),subjectViewDto.getPagesize());
        return Result.success(subject);
    }

}
